﻿// -------------------------------------------------------------------------
//    @FileName         :    NFCityCheckTimer.cpp
//    @Author           :    Gao.Yi
//    @Date             :    2025-09-16
//    @Email			:    445267987@qq.com
//    @Module           :    NFCityCheckTimer
//    @Desc             :
//
// -------------------------------------------------------------------------

#include "NFCityCheckTimer.h"

#include "NFCityPacketSendUtil.h"
#include "NFCitySession.h"
#include "NFCityPlayer.h"

int NFCityCheckTimer::SendClientRttSetClock(NFCitySession* pSession, int iSeq)
{
    CHECK_NULL(0, pSession);

    uint64_t ullRoleID = 0;
    if(pSession->GetPlayer() != nullptr)
    {
        ullRoleID = pSession->GetPlayer()->GetRoleID();
    }

    proto_ff::Proto_CSRsp rsp;
    proto_ff::Proto_CSRTTSetClockRsp& setClockRsp = *rsp.mutable_rtt_set_clock_rsp();
    setClockRsp.set_seq(iSeq);
    setClockRsp.set_time_now(NF_ADJUST_TIMENOW_MS());
    NFCityPacketSendUtil::SendToClient(pSession, E_CS_BATTLESVR_RTT_RSP, &rsp);

    return 0;
}
